pp108 : onrowselect Event (Grid)

onrowselect Event (Grid)


This event is fired when a row in the grid is selected.

Syntax

Inline HTML

<TABLE id=tableID onrowselect="handler()"...>

Event property

tableID.onrowselect = handler


Event Information

To invoke


  • Select a row from the grid.
  • Invoke method selectRow.

Default Action

Initiates any action associated with this event.


Event Object Properties


Although event handlers in the DHTML Object Model do not receive parameters directly, a handler can query an event object for data.

Property

Description

rowSelected

Read-only. Object that contains the last selected row.

tableID

Read-only. String that denotes the unique identifier of the table.


Remarks


TherowSelectedproperty will be able to show only the current row that is selected. So, when multiple rows are selected,rowSelectedproperty will point to the last row that was clicked.

Example


The following example shows how onselectrow event is used to get the row that is currently selected.

//function called by onselectrow
function fnRowSelected()
{
    //Alert the row element
    application.notify("The innerHTML for the row selected is " + application.event.rowSelected.innerHTML);
}

See Also


grid